<?php
/**
 * Joomla! 1.5 component NS Pro
 *
 * @version $Id: view.html.php 2009-04-28 01:47:12 svn $
 * @author Christopher Mavros
 * @package Joomla
 * @subpackage NS Pro
 * @license GNU/GPL
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

// Import Joomla! libraries
jimport( 'joomla.application.component.view');
class NsproViewTemplateEdit extends JView {

    function display($tpl = null)
    {

        $model  =& $this->getModel();
        $mtmpl  = $model->getTemplate();
        $isNew  = ($mtmpl->id < 1);

        $text = $isNew ? JText::_( 'New' ) : JText::_( 'Edit' );
        JToolBarHelper::title(   JText::_( 'HTML Templates' ).': <small><small>[ ' . $text.' ]</small></small>', 'thememanager.png' );
        JToolBarHelper::save('tsave');
        if ($isNew)  {
            JToolBarHelper::cancel('tcancel');
        } else {
            // for existing items the button is renamed `close`
            JToolBarHelper::cancel( 'tcancel');
        }

        $this->assignRef('mtmpl', $mtmpl);

        $this->assignRef('isNew', $isNew);

        parent::display($tpl);
    }
}
?>